<template name="EmailContent">
  <div class="spinner text-center" style="font-size: 30px;">
    <i class="fa fa-spinner fa-spin"></i>
  </div>
  <iframe frameborder="0" src="about:blank"></iframe>
</template>

<template name="EmailInfo">
  {{#with email}}
    {{#if compare state '===' 'failed'}}
      <i class="fa fa-warning text-red"></i> {{_ "email_sending_failed"}}
      <a href="#" class="btn-resend-email">{{_ "email_action_resend"}}</a>
    {{/if}}
    {{#if compare state '===' 'sending'}}
      <i class="fa fa-spinner fa-spin"></i> {{_ "email_state_sending"}}
    {{else}}
      {{#if subject}}<div>{{_ 'email_subject'}}: {{subject}}</div>{{/if}}
      {{#if to}}<div>{{_ 'email_to'}}: {{to}}</div>{{/if}}
      {{#if cc}}<div>{{_ 'email_cc'}}: {{cc}}</div>{{/if}}
      {{#if bcc}}<div>{{_ 'email_bcc'}}: {{bcc}}</div>{{/if}}
    {{/if}}
  {{/with}}
</template>

<template name="ThreadDetailEmail">
  <div class="panel flat-panel thread-detail">
    <div class="flat-panel-heading">
      <div class="flat-panel-title"><i class="fa fa-envelope-o text-blue"></i> {{_ 'Email'}}</div>
    </div>
    <div class="flat-panel-body">
      <div class="title">{{subject}}</div>
      <div class="small text-muted">{{_ "email_sent_by_and_when" name=user.name time=(formatDayWithTime createdAt)}}</div>
    </div>
  </div>
</template>
